<template>
  <Transition name="dialog-fade">
    <Teleport to="body" v-if="show">
      <div class="dialog">
        <div class="dialog-container"></div>
      </div>
    </Teleport>
  </Transition>
</template>
<script>
// import { Transition } from "vue";
export default {
  props: {
    show: {
      type: Boolean,
      require: true,
    },
  },
  data() {
    return {};
  },
  methods: {},
  mounted() {},
};
</script>
<style lang="scss" scoped>
.dialog {
  position: fixed;
  width: 100%;
  height: 100%;
  background-color: rgba($color: #000000, $alpha: 0.4);
  backdrop-filter: blur(10px);
  .dialog-container {
    width: inherit;
    height: inherit;
    position: relative;
    .dialog-main {
      width: 80%;
      margin: auto;
      height: 300px;
      background-color: beige;
      margin-top: 200px;
      text-align: center;
    }
  }
}
.dialog-fade-enter-active {
  animation: modal-fade-in 0.3s;
}

.dialog-fade-leave-active {
  animation: modal-fade-out 0.3s;
}

@keyframes modal-fade-in {
  0% {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  100% {
    opacity: 1;
    backdrop-filter: blur(10px);
  }
}

@keyframes modal-fade-out {
  0% {
    opacity: 1;
    backdrop-filter: blur(10px);
  }
  100% {
    backdrop-filter: blur(0px);
    opacity: 0;
  }
}
</style>
